﻿CKEDITOR.replace('editor', {
    on: {
        //focus: onFocus,
       // blur: onBlur,

        // Check for availability of corresponding plugins.
        pluginsLoaded: function (evt) {
            var doc = CKEDITOR.document, ed = evt.editor;
            if (!ed.getCommand('bold'))
                doc.getById('exec-bold').hide();
            if (!ed.getCommand('link'))
                doc.getById('exec-link').hide();
        }
    }
});

function InsertHTML(value) {
    // Get the editor instance that we want to interact with.
    var editor = CKEDITOR.instances.editor;

    // Check the active editing mode.
    if (editor.mode == 'wysiwyg') {
        editor.insertHtml(value);
    }
    else
        alert('You must be in WYSIWYG mode!');
}